unit issue;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, Buttons, ExtCtrls, RzButton, Grids, DBGrids, StrUtils,
  RzDBGrid, Mask, RzEdit, RzBckgnd;

type
  Tissuefrm = class(TForm)
    bg: TPanel;
    DataBG: TPanel;
    GroupBox: TGroupBox;
    pal_ctrl: TPanel;
    btnClose: TSpeedButton;
    labCaption: TLabel;
    DataSource: TDataSource;
    RzBitBtn1: TRzBitBtn;
    RzBitBtn2: TRzBitBtn;
    RzBitBtn3: TRzBitBtn;
    RzBitBtn4: TRzBitBtn;
    RzBitBtn5: TRzBitBtn;
    RzBitBtn6: TRzBitBtn;
    RzBitBtn7: TRzBitBtn;
    RzBitBtn8: TRzBitBtn;
    RzBitBtn9: TRzBitBtn;
    RzBitBtn10: TRzBitBtn;
    RzBitBtn11: TRzBitBtn;
    RzEdit1: TRzEdit;
    RzDBGrid1: TRzDBGrid;
    RFID: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    RzEdit2: TRzEdit;
    Label4: TLabel;
    Label5: TLabel;
    RzSeparator1: TRzSeparator;
    RzEdit3: TRzEdit;
    RzEdit4: TRzEdit;
    RzEdit5: TRzEdit;
    RzBitBtn12: TRzBitBtn;
    RzBitBtn13: TRzBitBtn;
    procedure pal_ctrlResize(Sender: TObject);
    procedure btnCloseClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure RzBitBtn1Click(Sender: TObject);
    procedure RzBitBtn12Click(Sender: TObject);
    procedure RzBitBtn13Click(Sender: TObject);
    procedure RzDBGrid1CellClick(Column: TColumn);
    procedure RzBitBtn11Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  procedure IssuePunnet(Parent:TWinControl);overload;
  procedure IssuePunnet(Parent:TWinControl;RFID:string);overload;
implementation

{$R *.dfm}

uses
  datmd;

procedure IssuePunnet(Parent:TWinControl);
var
  issuefrm: Tissuefrm;
begin
  issuefrm:=Tissuefrm.Create(Parent);
  issuefrm.Parent:=Parent;
  issuefrm.Show;
end;

procedure IssuePunnet(Parent:TWinControl;RFID:string);
var
  issuefrm: Tissuefrm;
begin
  issuefrm:=Tissuefrm.Create(Parent);
  issuefrm.Parent:=Parent;
  issuefrm.RzEdit3.Text:=RFID;
  issuefrm.Show;
end;

procedure Tissuefrm.pal_ctrlResize(Sender: TObject);
begin
  btnClose.Left:=pal_ctrl.Width-btnClose.Width-3;
end;

procedure Tissuefrm.btnCloseClick(Sender: TObject);
begin
  Close;
end;

procedure Tissuefrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  DataSource.DataSet.Active:=False;
end;

procedure Tissuefrm.FormCreate(Sender: TObject);
begin
  DataSource.DataSet:=datmdfrm.Punnet;
  DataSource.DataSet.Active:=True;
end;

procedure Tissuefrm.RzBitBtn1Click(Sender: TObject);
begin
  RzEdit1.Text:=RzEdit1.Text+Trim(inttostr(TRzBitBtn(Sender).Tag));
end;

procedure Tissuefrm.RzBitBtn12Click(Sender: TObject);
begin
  RzEdit1.Text:=LeftStr(RzEdit1.Text,Length(RzEdit1.Text)-1);
end;

procedure Tissuefrm.RzBitBtn13Click(Sender: TObject);
begin
  RzEdit2.Text:='';RzEdit1.Text:='';
  RzDBGrid1.SetFocus;
end;

procedure Tissuefrm.RzDBGrid1CellClick(Column: TColumn);
begin
  //
end;

procedure Tissuefrm.RzBitBtn11Click(Sender: TObject);
begin
  //
end;

end.
